package com.project.dao;

import java.util.List;

import com.project.vo.Admin;
import com.project.vo.User;
import com.project.vo.Validator;

public interface UserDao {

	/**
	 * login by username
	 * @param username
	 * @param password
	 * @return
	 */
	public User login(Integer userId, String password);
	public Admin login_A(Integer id, String password);
	/**
	 * forget and find password
	 * @param username
	 * @param password
	 * @return
	 */
	public String updatePassword(Integer userId, String password);
	
	/**
	 * register user's personal info
	 * @param user
	 * @return
	 */
	public String register(User user);

	/**
	 * update user's personal info
	 * @param oldName 
	 * @param user
	 * @return
	 */
	public String update(Integer userId, User user);

	/**
	 * view user's personal info
	 * @param name
	 * @return
	 */
	public User view(Integer userId);
	public Admin view_A(Integer id);

	/**
	 * save validation code
	 * @param email
	 * @param code
	 * @return
	 */
	public String saveCode(String email, String code);

	/**
	 * findUserByEmail
	 * @param email
	 * @return
	 */
	public User findUserByEmail(String email);

	/**
	 * findValidatorByEmail
	 * @param email
	 * @return
	 */
	public Validator findValidatorByEmail(String email);

	/**
	 * get all users
	 * @param pageSize 
	 * @param pageNum 
	 * @return
	 */
	public List<User> getAllUser(Integer pageNum, Integer pageSize);
	public List<User> getAllUser();
	/**
	 * delete user
	 * @param id
	 * @return
	 */
	public String delete(Integer id);
}
